package com.muchfish.reactor.api;

import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;

public class ReactorCreateExample {
    public static void main(String[] args) {
        // 创建包含单个元素的 Mono
        Mono<String> mono = Mono.just("Hello, Reactor!");

        // 创建包含多个元素的 Flux
        Flux<Integer> flux = Flux.fromArray(new Integer[]{1, 2, 3, 4, 5});

        mono.subscribe(System.out::println); // 输出: Hello, Reactor!
        flux.subscribe(System.out::println); // 输出: 1, 2, 3, 4, 5
    }
}

